package com.wushi.lenovo.asia5b.app_model.good;

import android.text.TextUtils;

import com.mvp.base.model.BaseModel;
import com.wushi.lenovo.asia5b.app_model.good.goodbean.OrderGoodBean;
import com.wushi.lenovo.asia5b.app_model.profile.AddressModel;

import java.io.Serializable;
import java.util.List;

/**
 * Created by zhangyuncai on 2019/2/1.
 */
public class OrderDetailModel extends BaseModel {
    public String getPaymentAddress() {
        StringBuilder stringBuilder = new StringBuilder();
        if (!TextUtils.isEmpty(getPayment_address_1())) {
            stringBuilder.append(getPayment_address_1());
            stringBuilder.append(" ");
        }
        if (!TextUtils.isEmpty(getPayment_postcode())) {
            stringBuilder.append(getPayment_postcode());
            stringBuilder.append(" ");
        }
        if (!TextUtils.isEmpty(getPayment_city())) {
            stringBuilder.append(getPayment_city());
            stringBuilder.append(" ");
        }
        if (!TextUtils.isEmpty(getPayment_state_name())) {
            stringBuilder.append(getPayment_state_name());
            stringBuilder.append(" ");
        }
        if (!TextUtils.isEmpty(getPayment_country_name())) {
            stringBuilder.append(getPayment_country_name());
        }
        return stringBuilder.toString();
    }

    /**
     * order_id : 375
     * order_no : SO5B190001126
     * shipping_name : Tun Dr. Mahathir
     * shipping_mobile : +60165022919
     * shipping_building_name : Seri Perdana Complex
     * shipping_address_1 : Persiaran Seri Perdana, Presint 10,
     * shipping_address_2 :
     * shipping_city : Kuala Lumpur
     * shipping_postcode : 1111
     * shipping_state_name : Kuala Lumpur
     * shipping_country_name : Malaysia
     * payment_name : Tun Dr. Mahathir
     * payment_mobile : -
     * payment_building_name : Seri Perdana Complex
     * payment_address_1 : Persiaran Seri Perdana, Presint 10,
     * payment_address_2 :
     * payment_city : Kuala Lumpur
     * payment_postcode : 62250
     * payment_state_name : null
     * payment_country_name : Malaysia
     * international_shipping_method : Economy Air
     * order_datetime : {"date":"2019-01-25 15:47:37.000000","timezone_type":3,"timezone":"Asia/Kuala_Lumpur"}
     * delivered_status : 0
     * order_parcel : [{"id":28919,"product_id":146,"product_name":"Europe and the United States 2018 summer new Slim thin stacked decorative lotus leaf side sleeve top 2672/041 2672041","image":"//img.alicdn.com/imgextra/i3/2535708021/TB2MdhflXuWBuNjSszbXXcS7FXa_!!2535708021.jpg","quantity":3,"weight":"1.10","unit":"RM","price":"72.54","diff_price":"0.00","diff_domestic":"0.00","kgorm3":"kg","is_sensitive":0,"status_name":"Pending NG Second Confirm","remark":"CNY+Sales","attr_name":"S,White"},{"id":28920,"product_id":217,"product_name":"Magnetic Puzzle young children's educational toys 1-3-6-year-old boys and Girls 2 babies 4 early education 5 spell music Intelligence","image":"//img.alicdn.com/imgextra/i2/2207839197/TB2mNTflZyYBuNkSnfoXXcWgVXa_!!2207839197.jpg","quantity":1,"weight":"24.20","unit":"RM","price":"19.10","diff_price":"5.46","diff_domestic":"0.00","kgorm3":"kg","is_sensitive":0,"status_name":"Pending NG Second Confirm","remark":"CNY+Sales","attr_name":""},{"id":28921,"product_id":1400,"product_name":"30mlPP Lanzhi Emulsion Vacuum bottle wash face Milk cosmetics split bottle moisturizing milk Powder Bottom press Buckle","image":"//img.alicdn.com/imgextra/i1/811739806/TB2hAYFe0LO8KJjSZPcXXaV0FXa_!!811739806.jpg","quantity":10,"weight":"65.88","unit":"RM","price":"17.40","diff_price":"0.00","diff_domestic":"0.00","kgorm3":"kg","is_sensitive":0,"status_name":"Paid","remark":"Wrapped+with+boxes","attr_name":"Sample 1 to 11 PCs"},{"id":28922,"product_id":1400,"product_name":"30mlPP Lanzhi Emulsion Vacuum bottle wash face Milk cosmetics split bottle moisturizing milk Powder Bottom press Buckle","image":"//img.alicdn.com/imgextra/i1/811739806/TB2hAYFe0LO8KJjSZPcXXaV0FXa_!!811739806.jpg","quantity":10,"weight":"156.17","unit":"RM","price":"14.90","diff_price":"0.00","diff_domestic":"0.00","kgorm3":"kg","is_sensitive":0,"status_name":"Paid","remark":"Wrapped+with+boxes","attr_name":"12 Sales"},{"id":28956,"product_id":148,"product_name":"Japanese retro wave seven-cent sleeve kimono cardigan male bf Loose thin section half-sleeve shirt where sunscreen coat","image":"//img.alicdn.com/imgextra/i4/2793555335/TB2erHFhACWBuNjy0FaXXXUlXXa_!!2793555335.jpg","quantity":9,"weight":"1.10","unit":"RM","price":"327.51","diff_price":"0.00","diff_domestic":"0.00","kgorm3":"kg","is_sensitive":0,"status_name":"Paid","remark":"","attr_name":"XL,Black Spot"}]
     * order_charges : [{"code":"international","amount":"2485.00","unit":"RM","title":"International Shipping Fee"},{"code":"processingcosting","amount":"58.62","unit":"RM","title":"Processing Fee"},{"code":"local","amount":"0.00","unit":"RM","title":"Malaysia Local Delivery Fee"},{"code":"insurancecosting","amount":"87.93","unit":"RM","title":"Parcel Handling Guarantee fees"},{"code":"total","amount":"3077.54","unit":"RM","title":"TOTAL INVOICE AMOUNT"}]
     * transaction_data : [{"id":454,"name":"Invoice","reference_number":"A5B180000126","unit":"RM","credit":" - ","debit":"3077.54","transaction_date":{"date":"2019-01-25 15:47:37.000000","timezone_type":3,"timezone":"Asia/Kuala_Lumpur"}}]
     */

    private int order_id;
    private String order_no;
    private String shipping_name;
    private String shipping_mobile;
    private String shipping_building_name;
    private String shipping_address_1;
    private String shipping_address_2;
    private String shipping_city;
    private String shipping_postcode;
    private String shipping_state_name;
    private String shipping_country_name;
    private String payment_name;
    private String payment_mobile;
    private String payment_building_name;
    private String payment_address_1;
    private String payment_address_2;
    private String payment_city;
    private String payment_postcode;
    private String payment_state_name;
    private String payment_country_name;
    private String international_shipping_method;
    private String payment_method;
    private String add_on_services;
    private String order_date;
    private OrderDatetimeBean order_datetime;
    private int delivered_status;
    public int show_order_track;//是否有物流信息
    private List<OrderGoodBean> order_parcel;
    private OrderGoodBean.ActionBean order_action;
//    order_action
    /**
     * code : international
     * amount : 2485.00
     * unit : RM
     * title : International Shipping Fee
     */
    private List<ChargesBean> order_charges;
    private List<TransactionDataBean> transaction_data;
    private AddressModel delivery_address;//收货地址
    private AddressModel billing_address;//账单地址

    public AddressModel getDelivery_address() {
        return delivery_address;
    }

    public AddressModel getBilling_address() {
        return billing_address;
    }


    public OrderGoodBean.ActionBean getOrder_action() {
        return order_action;
    }

    public String getPayment_method() {
        return payment_method;
    }

    public int getOrder_id() {
        return order_id;
    }

    public String getOrder_no() {
        return order_no;
    }

    public String getShipping_name() {
        return shipping_name;
    }

    public String getShipping_mobile() {
        return shipping_mobile;
    }

    public String getShipping_building_name() {
        return shipping_building_name;
    }

    public String getOrder_date() {
        return order_date;
    }

    public String getShipping_address_1() {
        return shipping_address_1;
    }


    public String getShipping_address_2() {
        return shipping_address_2;
    }


    public String getShipping_city() {
        return shipping_city;
    }


    public String getShipping_postcode() {
        return shipping_postcode;
    }


    public String getShipping_state_name() {
        return shipping_state_name;
    }


    public String getShipping_country_name() {
        return shipping_country_name;
    }


    public String getPayment_name() {
        return payment_name;
    }


    public String getPayment_mobile() {
        return payment_mobile;
    }


    public String getPayment_building_name() {
        return payment_building_name;
    }


    public String getPayment_address_1() {
        return payment_address_1;
    }


    public String getPayment_address_2() {
        return payment_address_2;
    }


    public String getPayment_city() {
        return payment_city;
    }


    public String getPayment_postcode() {
        return payment_postcode;
    }


    public String getPayment_state_name() {
        return payment_state_name;
    }


    public String getPayment_country_name() {
        return payment_country_name;
    }


    public String getInternational_shipping_method() {
        return international_shipping_method;
    }

    public String getAdd_on_services() {
        return add_on_services;
    }

    public OrderDatetimeBean getOrder_datetime() {
        if (order_datetime == null) {
            order_datetime = new OrderDatetimeBean();
        }
        return order_datetime;
    }

    public int getDelivered_status() {
        return delivered_status;
    }


    public List<OrderGoodBean> getOrder_parcel() {
        return order_parcel;
    }


    public List<ChargesBean> getOrder_charges() {
        return order_charges;
    }


    public List<TransactionDataBean> getTransaction_data() {
        return transaction_data;
    }

    public void setTransaction_data(List<TransactionDataBean> transaction_data) {
        this.transaction_data = transaction_data;
    }

    public static class OrderDatetimeBean extends BaseModel {
        /**
         * date : 2019-01-25 15:47:37.000000
         * timezone_type : 3
         * timezone : Asia/Kuala_Lumpur
         */

        private String date;
        private String timezone_type;
        private String timezone;

        public String getDate() {
            return date;
        }

        public String getTimezone() {
            return timezone;
        }
    }


    public static class TransactionDataBean implements Serializable {
        /**
         * id : 454
         * name : Invoice
         * reference_number : A5B180000126
         * unit : RM
         * credit :  -
         * debit : 3077.54
         * transaction_date : {"date":"2019-01-25 15:47:37.000000","timezone_type":3,"timezone":"Asia/Kuala_Lumpur"}
         */

        private int id;
        private String name;
        private String reference_number;
        private String unit;
        private String credit;
        private String debit;
        private String pdf_download_path;
        private String receipt_image_path;
        private String transaction_date;

        public String getReceipt_image_path() {
            return receipt_image_path;
        }

        public String getPdf_download_path() {
            return pdf_download_path;
        }

        public int getId() {
            return id;
        }

        public String getName() {
            return name;
        }

        public String getReference_number() {
            return reference_number;
        }


        public String getUnit() {
            return unit;
        }


        public String getCredit() {
            return credit;
        }

        public String getDebit() {
            return debit;
        }


        public String getTransaction_date() {
            return transaction_date;
        }
    }

}
